<include file="Public/head" />
<include file="Public/sider" />
<div id="layoutRight" class="ncsc-layout-right">
    <div class="ncsc-path"><i class="icon-desktop"></i>商家管理中心<i class="icon-angle-right"></i>订单物流<i class="icon-angle-right"></i>订单列表</div>
    <div class="main-content" id="mainContent">
        <div class="tabmenu">
            <ul id="tab" class="tab pngFix">
                <li class="active" data-val=""><a >待发货</a></li>
            </ul>
        </div>
        <form method="post" action="{:U(Order/sendlist)}" id="search-form2">
            <table class="search-form">
                <tr>
                    <th>收货人</th>
                    <td class="w150">
                        <input type="text" class="text w150" name="uname" placeholder="收货人" value="{$search.uname}" />
                    </td>
                    <th>订单编号</th>
                    <td class="w150">
                        <input type="text" class="text w150" name="order_sn" placeholder="订单编号" value="{$search.order_sn}" />

                    </td>
                    <th>下单时间</th>
                    <td class="w378">
                        <input type="text" class="text w150" name="start_time" id="add_time_begin" placeholder="开始时间" value="{$search.start_time}" />
                        <input type="text" class="text w150" name="end_time" id="add_time_end" placeholder="结束时间" value="{$search.end_time}" />
                    </td>
                </tr>
                <tr>
                    <th></th>
                    <td class="w160">

                    </td>
                    <th></th>
                    <td class="w160">

                    </td>
                    <th>支付方式</th>
                    <td>
                        <select name="exchange_type" class="w150 w160 di-in">
                            <option value="3" <if condition="$search.exchange_type == 3">selected</if>>支付方式</option>
                            <option value="0" <if condition="$search.exchange_type == 0">selected</if>>电子支付</option>
                            <option value="1" <if condition="$search.exchange_type == 1">selected</if>>七彩币</option>
                        </select>
                        <label class="submit-border">
                            <input type="submit" class="submit" value="搜索" >
                        </label>
                    </td>
                </tr>
            </table>
        </form>
        <div id="ajax_return">
            <table class="ncsc-default-table order">
                <thead>
                <tr>


                    <th class="w100">单价（元）</th>
                    <th class="w100">买家</th>
                    <th class="w100">订单金额</th>
                    <th class="w90">交易方式</th>
                    <th class="w100">状态</th>
                    <th class="w120">交易操作</th>
                </tr>
                </thead>

                <volist name="orderList" id="vo">
                    <tbody>
                    <tr>
                        <td colspan="20" class="sep-row"></td>
                    </tr>
                    <tr>
                        <th colspan="20">
                            <span class="ml10">订单编号：<em>{$vo.order_order_sn}</em></span> <span>下单时间：<em class="goods-time">{$vo.order_add_time|date="y-m-d H:i:s",###}</em></span>
                            <if condition="$vo.order_order_state eq 20">
                                <if condition="$vo.order_shipping_code neq ''">
                                    <span style="display: none" class="fr mr10"><a href="{:U('order_Print',['id'=>$vo['order_id']])}" target="_blank" class="ncbtn-mini" title="打印配货单"><i class="icon-print"></i>打印配货单</a></span>
                                </if>
                            </if>
                        </th>
                    </tr>
                    <!--  第一行 -->
                    <tr>



                        <td  class="bdl bdr" rowspan="1">
                            <p> <if condition="$vo.order_exchange_type eq 0">

                                {$vo.order_order_money}

                                <else/>
                                {$vo.order_order_sell_price}
                            </if></p>
                        </td>

                        <!-- S 合并TD -->
                        <td class="bdl" rowspan="1">
                            <div class="buyer">{$vo.address_uname}
                                <p member_id="5"></p>
                                <div class="buyer-info"> <em></em>
                                    <div class="con">
                                        <h3><i></i><span>联系信息 </span></h3>
                                        <dl>
                                            <dt>姓名：</dt>
                                            <dd>{$vo.address_uname}</dd>
                                        </dl>
                                        <dl>
                                            <dt>电话：</dt>
                                            <dd>{$vo.address_mobile}</dd>
                                        </dl>
                                        <dl>
                                            <dt>地址：</dt>
                                            <dd>{$vo.address_province}省{$vo.address_province}市{$vo.address_area}区(县){$vo.address_address}</dd>
                                        </dl>
                                    </div>
                                </div>
                            </div>
                        </td>
                        <td class="bdl" rowspan="1">
                            <p class="ncsc-order-amount"></p>
                            <p class="goods-freight">邮费:{$vo.order_shipping_fee}</p>
                            <p class="goods-pay" title="支付方式："></p>
                        </td>
                        <td class="bdl bdr" rowspan="1">
                            <p>
                                <if condition="$vo.order_exchange_type eq 0">
                                    电子币
                                    <else/>
                                    七彩币
                                </if>
                            </p>
                            <!-- 物流跟踪 -->
                            <p></p>
                        </td>
                        <!--   <td class="tl">
                               <dl  class="goods-name">
                                   <dt>{$vo.order_order_state}</dt>
                               </dl>
                           </td>-->
                        <td class="bdl bdr" rowspan="1">
                            <p>
                                {$vo.state_name}
                            </p>
                            <!-- 物流跟踪 -->
                            <p></p>
                        </td>
                        <!-- 取消订单 -->
                        <td class="nscs-table-handle" rowspan="1">
                            <span><a href="{:U('order/details',['id'=>$vo['order_id']])}" class="ncbtn-mint"><i class="icon-search"></i><p>详情</p></a></span>
                            <span><a href="javascript:void(0)" onclick="del({$vo.order_id})" class="btn-grapefruit"><i class="icon-trash"></i><p>删除</p></a></span>
                        </td>
                    </tr>
                    </tbody>
                </volist>



                <tfoot>
                <tr>
                    <td colspan="20">
                        {$page}
                    </td>
                </tr>
                </tfoot>
            </table>
        </div>
        <script>
            $(document).ready(function() {

                $('#add_time_begin').layDate();
                $('#add_time_end').layDate();

              /*  ajax_get_table('search-form2', 1);

                $("#tab > li").each(function() {
                    $(this).click(function() {
                        tabSelect(this);
                    });
                });*/
            });

          /*  function tabSelect(obj) {
                var currHasClass = $(obj).hasClass('active');
                if (currHasClass) return;

                $("#tab > li").each(function() {
                    $(this).removeClass('active');
                });

                $(obj).addClass('active');
                var orderStatus = $(obj).attr("data-val");

                console.log("orderStatus:" + orderStatus);

                $("#order_status").val(orderStatus);
                ajax_get_table('search-form2', 1);
            }*/

           /* //ajax 抓取页面
            function ajax_get_table(tab, page) {
                cur_page = page; //当前页面 保存为全局变量
                $.ajax({
                    type: "POST",
                    url: "/index.php/Seller/order/ajaxindex/p/" + page, //+tab,
                    data: $('#' + tab).serialize(), // 你的formid
                    success: function(data) {
                        $("#ajax_return").html('');
                        $("#ajax_return").append(data);
                    }
                });
            }*/

            function del(id){
                //询问框
                layer.confirm('确认删除？', {
                    btn: ['确定','取消'] //按钮
                }, function(){
                    $.get('{:U("order/del")}',{id:id},function(res){
                        alert(id);
                       // icon=res.res==1?1:2;
                        layer.msg(res.msg, {icon: res.res==1?1:2});
                    });

                }, function(){

                });
            }
        </script>
    </div>
</div>
</div>
<div id="cti">
    <div class="wrapper">
        <ul>
        </ul>
    </div>
</div>
<div id="faq">
    <div class="wrapper">
    </div>
</div>

<include file="Public/foot" />